package cn.edu.seig.textbook.repositiory;

import cn.edu.seig.textbook.domain.pojo.Permissions;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PermissionsRepositiory extends JpaRepository<Permissions, Integer> {

    @Query(value = "select r.* from tb_permissions r,tb_users u where r.permission_id=u.permission_id and u.username=?1",nativeQuery = true)
    public List<Permissions> findPermissionsByUsername(String username);

}
